{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# HybridGaussianProductFactor"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "`HybridGaussianProductFactor` is a specialized `DecisionTree` used internally during hybrid elimination. It represents a collection of `GaussianFactorGraph`s, each associated with a specific assignment of a set of discrete variables, along with a scalar value accumulated for that assignment.\n",
        "\n",
        "Specifically, it's a `DecisionTree<Key, GaussianFactorGraphValuePair>`, where `GaussianFactorGraphValuePair` is `std::pair<GaussianFactorGraph, double>`.\n",
        "\n",
        "Its primary role is to hold the intermediate results when eliminating a continuous variable that has discrete variables in its separator/conditional parents. When eliminating such a variable, the resulting factor on the separator involves:\n",
        "1.  A set of purely continuous factors (a `GaussianFactorGraph`).\n",
        "2.  A scalar term (representing accumulated constants or log-likelihoods).\n",
        "This pair depends on the assignment of the discrete separator variables. The `HybridGaussianProductFactor` stores these pairs in a decision tree structure indexed by the discrete keys.\n",
        "\n",
        "While crucial internally for elimination algorithms like `EliminateHybrid`, direct user interaction with `HybridGaussianProductFactor` is less common compared to `HybridGaussianFactor` or `HybridGaussianConditional`. It can be thought of as the precursor structure from which a `HybridGaussianFactor` or `HybridGaussianConditional` is formed after elimination."
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "py312",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.12.6"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
